ADBReInit
ADBReInit
Initialize the bus, clear the device table, reset all devices ADBReInit sets the Apple Desktop Bus back to its startup condition all the way around. It clears the device table and sends a reset to every device on the
bus.
Return: none
Notes: Apple Technical Notes clarify some points about the use of ADBReInit. First, ignore the part in Inside Macintosh V that says to use this call when
connecting devices to systems that are already running. Never physically
connect anything to a Macintosh when it is running. What was meant was
that you can use this call to reinitialize the bus if you want to toggle
between already connected devices with a software command. Because
SetADBInfo will let you add new devices, too, you may not want to reinitialize the entire bus, device table, and all other connected devices if
you don't have to.
However, if you need to use this routine, we're advised that a bug involving
the keyboard layout resources 'KCHR' causes ADBReInit to always reinitialize keyboards to the standard U.S. layout (ID =0), dumping
nonstandard and non-U.S. layouts in the process. Systems Tools disks after
6.0.4 repair the problem.
Also, according to Apple Tech Note 143, if you're using System 4.1 on an
SE, a patch to a different bug interferes with ADBReInit and causes it to
always reload the ROM version of the keyboard driver. The problem is said
to be peculiar to this machine with this version of the System.
ADBReInit calls a routine pointed to by the variable JADBProc when it begins and ends executing. This is where you can insert your own
preprocessing or postprocessing routine by inserting a new value for the
variable. The reinitialization process conditions the variable by setting
register D0 = 0 for preprocessing and register D0 = 1 for post processing.
What you have to do is restore the value of D0 and branch to the original
value of the variable JADBProc when you exit.